<template>
	<view>
		<view class="">
			<image v-for="(img, i) in ImgList" :key="i" :src="img" @click="previewImg(img)" mode="widthFix"></image>
		</view>
		<cus-previewImg ref="cusPreviewImg" :list="ImgList" />
	</view>
</template>

<script>
	import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue'
	export default {
		components: {
			cusPreviewImg
		}, //注册插件

		data() {
			return {
				ImgList: [
					'/static/call-blue.png', '/static/call-fail.png', '/static/call-warn.png'
				]
			};
		},

		methods: {
			previewImg(url) { // 点击预览图片
				console.log('00')
				this.$refs.cusPreviewImg.open(url) // 传入当前选中的图片地址
			}
		}
	}
</script>

<style lang="less" scoped>
	.preview-pic {
		position: fixed;
		left: 0;
		top: 0;
		bottom: 0;
		right: 0;
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		z-index: 2021;
		background-color: #000000;

		movable-area {
			height: 100%;
			width: 100%;
		}

		movable-view image {
			width: 100%;
		}

		.pic {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			height: 100%;
			display: flex;
			background-color: #FFFFFF;

			image {
				width: 100%;
			}
		}
	}
</style>
